@nightPreviewColor: #191919;
@nightCodeMirrorColor: #191919;
@nightActiveCodeMirrorColor: gray;
@nightFontColor: gray;
@nightLinkColor: #8e9eb9;
@nightLinkTextColor: #84868b;
@nightLineColor: #84868b;

.dark {
  .container {
    // CodeMirror v6 兼容
    .cm-editor,
    .CodeMirror-wrap {
      background-color: @nightCodeMirrorColor;
    }

    .output_night {
      .preview {
        background-color: @nightPreviewColor;
        box-shadow: 0 0 70px rgba(0, 0, 0, 0.3);
      }

      .preview-wrapper {
        background-color: @nightCodeMirrorColor;
        box-shadow: inset 0 0 0 1px rgba(233, 231, 231, 0.102);
      }

      .code-snippet__fix {
        background-color: rgb(238, 238, 238);
      }
    }

    ::-webkit-scrollbar {
      background-color: @nightCodeMirrorColor;
    }
  }
}

// CodeMirror v5 兼容样式
.CodeMirror {
  padding-bottom: 0;
  height: 100% !important;
  font-size: 16px;
  font-family: Consolas, 'Courier New', monospace !important;
}

.CodeMirror-vscrollbar:focus {
  outline: none;
}

.CodeMirror-vscrollbar {
  width: 0px;
  height: 0px;
}

.CodeMirror-wrap {
  padding-top: 20px;
  padding-bottom: 20px;
  box-sizing: border-box;
}

// CodeMirror v6 样式
.cm-editor {
  height: 100% !important;
  font-size: 16px;
  font-family: Consolas, 'Courier New', monospace !important;

  .cm-scroller {
    overflow-x: auto !important;
    overflow-y: auto !important;

    // 只隐藏 x 方向的滚动条
    &::-webkit-scrollbar:horizontal {
      display: none; /* Chrome/Safari/Webkit - 横向滚动条 */
    }
  }

  .cm-content {
    padding-bottom: 20px;
  }

  &.cm-focused {
    outline: none;
  }
}

.codemirror-container {
  height: 100%;
  width: 100%;

  .cm-scroller {
    padding: 10px;
  }
}

.cssEditor-wrapper {
  .CodeMirror-scroll,
  .cm-scroller {
    margin-right: 0;
  }
}

.cm-em {
  font-style: normal;
}

.cm-comment {
  font-style: normal !important;
}
